package com.archgeek.java.conc;

import org.junit.Test;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.LongAdder;

/**
 * @author pizhihui
 * @date 2024-03-21 11:41
 */
public class AtomicDemo {

    @Test
    public void test1() {
        AtomicInteger atomicInteger = new AtomicInteger(5);

        System.out.println(atomicInteger.compareAndSet(5, 308) + "..." + atomicInteger.get());
        System.out.println(atomicInteger.compareAndSet(5, 903) + "...." + atomicInteger.get());



    }


}
